/*package com.controllers;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/login")
public class LoginController {

	
		@RequestMapping(method = RequestMethod.GET)
		
		public ModelAndView get(){
			return new ModelAndView("login/login");
		}
		@RequestMapping(method = RequestMethod.POST)
		public ModelAndView post(HttpServletRequest req,HttpSession session,
				@RequestParam String username, @RequestParam String password,
				@RequestParam(required=false) String returnUrl){
				
				if (username.equals("admin") && password.equals("123456")) {
					session.setAttribute("username",username);
					if (returnUrl!=null) {
						return new ModelAndView("redirect:"+
					returnUrl.replace(req.getContextPath(), ""));
					}else {
						return new ModelAndView("redirect:depot");
					}
				}else{
					ModelAndView mav =new ModelAndView("/login/login");
					mav.addObject("error","用户名或密码错误！！");
					return mav;
				}
				
			}
}*/
